<!-- 首页 -->
<template>
	<view class="home-wrap u-m-b-20">
		
		<sh-banner
			Px="0"
			Py="0"
			borderRadius="0"
			height="406"
			:list="bannerList"
		></sh-banner>
		
		<scan/>
		
	
			<!-- 登录提示 -->
			<shopro-auth-modal></shopro-auth-modal>
			<!-- 悬浮按钮 -->
			<shopro-float-btn></shopro-float-btn>
			<!-- 连续弹窗提醒 -->
			<shopro-notice-modal v-if="!showPrivacy && isLogin"></shopro-notice-modal>
			<!-- 隐私协议 -->
			<!-- #ifdef APP-PLUS -->
			<privacy-modal v-if="initShop && initShop.name" v-model="showPrivacy"></privacy-modal>
			<!-- #endif -->
			<!-- #ifdef H5 -->
			<view class="tabbar-hack" style="height: 120rpx; width:100%;"></view>
			<!-- #endif -->
		</view>
		<!-- <shopro-tabbar></shopro-tabbar> -->
	</view>
</template>

<script>
import scan from './components/scan.vue';
import shBanner from './components/sh-banner.vue';


import privacyModal from './index/privacy-modal.vue';


import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
export default {
	components: {
		scan,
		shBanner,
		

		privacyModal,

	},
	data() {
		return {		
			isRefresh: true,

			enable: false, //是否开启吸顶。
			isConnected: true, //是否有网
			showPrivacy: false, //协议
			isScorll: false,
			
			
			bannerList: [
				{
					bgcolor: "#a71f23",
					image: require('../../static/images/bg.png'),
					name: "",
					path: "",
					path_name: "",
					path_type: 1
				}
			]
		};
	},
	computed: {
		...mapGetters(['isLogin']),
	},
	onPageScroll(e) {
		this.isScorll = e.scrollTop > 100 ? true : false;
	},
	onShow() {
		let that = this;
		this.enable = true;
		// 网络变化检测
		uni.onNetworkStatusChange(res => {
			this.isConnected = res.isConnected;
			res.isConnected && this.init();
		});
	},
	onHide() {
		this.enable = false;
	},
	onLoad() {
		// #ifdef APP-VUE
		// app隐私协议弹窗
		if (!plus.runtime.isAgreePrivacy()) {
			this.showPrivacy = true;
			this.showNoticeModal = false;
		}
		// #endif
	},
	methods: {

	}
};
</script>

<style lang="scss">
	
</style>
